package com.tiocloud.chat.feature.session.common.mvp;

import com.tiocloud.chat.feature.session.common.proxy.MsgListProxy;
import com.tiocloud.session.event.AgreeJoinGroupEvent;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class SessionFragmentPresenter extends SessionFragmentContract.Presenter {
    public SessionFragmentPresenter(SessionFragmentContract.View view) {
        super(new SessionFragmentModel(), view, true);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onAgreeJoinGroupEvent(AgreeJoinGroupEvent event) {
        String mid = event.mid;
        if (mid == null) return;
        MsgListProxy proxy = getView().getMsgListProxy();
        proxy.handleApplyMsg(mid);
    }
}
